package com.lh.ssm.web;

import com.lh.ssm.domain.Type;
import com.lh.ssm.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/type")
public class TypeController {
    @Autowired
    private TypeService typeService;
    /**
     * 查询所有的商品分类
     */
    @ResponseBody
    @GetMapping("/findAll")
    public List<Type> findAll() {

        List<Type> list = typeService.findAll();
        return list;
    }
}
